package com.zbkj.crmeb.store.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.crmeb.core.common.CommonResult;
import com.zbkj.crmeb.front.request.IndexStoreProductSearchRequest;
import com.zbkj.crmeb.store.model.StoreProduct;
import com.zbkj.crmeb.store.model.StoreProductMer;
import com.zbkj.crmeb.store.request.*;
import com.zbkj.crmeb.store.vo.StoreProductMerVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商户商品
 * @Description: 
 * @author daigb
 * @date 2021-05-19
 */
public interface StoreProductMerService extends IService<StoreProductMer> {
    
    /**
     * 启用或禁用商户商品
     * @Description:  
     * @author daigb 
     * @param @param vo
     * @param @return
     * @return Boolean
     * @throws
     */
    Boolean enabled(String token, StoreProductMerVo vo);
    
    /**
     * 加入小编推荐
     * @Description:  
     * @author daigb 
     * @param @param token
     * @param @param vo
     * @param @return
     * @return Boolean
     * @throws
     */
    Boolean best(String token, StoreProductMerVo vo);
    
    /**
     * 修改云仓商品数据
     * @Description:  
     * @author daigb 
     * @param @param token
     * @param @param vo
     * @param @return
     * @return Boolean
     * @throws
     */
    Boolean updateByCloud(StoreProductMerRequest storeProductMerRequest, Integer merId);
    
    /**
     * 云仓商品批量加价
     * @Description:  
     * @author daigb 
     * @param @param productIds
     * @param @param price
     * @param @param merId
     * @param @return
     * @return Boolean
     * @throws
     */
    Boolean raiseByCloud(List<Integer> productIds, BigDecimal price, Integer merId);

    /**
     * 查询状态下的商品ids
     * @author cyz
     * @date 2021/5/20 10:40
     * @param vo
     * @return java.util.List<java.lang.Integer>
     */
    List<Integer> selectProductIdList(StoreProductMerVo vo);

//    /**
//     * 查询上架状态下的推荐商品ids
//     * @author cyz
//     * @date 2021/5/20 10:40
//     * @param vo
//     * @return java.util.List<java.lang.Integer>
//     */
//    List<Integer> selectProductBestIdList(StoreProductMerVo vo);

    List<StoreProduct> getProductIdList(IndexStoreProductSearchRequest request);

    /**
     * 批量上架/下架
     * @param token
     * @param vo
     * @return
     */
    Boolean batchEnabled(String token, BatchEnabledRequest vo);

    /**
     * 批量修改佣金比例
     * @param token
     * @param vo
     * @return
     */
    Boolean batchEditRebateRate(String token, BatchEditRebateRateRequest vo);

    /**
     * 批量推荐
     * @param token
     * @param vo
     * @return
     */
    Boolean batchBest(String token, BestEnabledRequest vo);

    /**
     * 批量修改价格
     * @param request
     * @param merId
     * @return
     */
    CommonResult<Object> batchUpdatePrice(BatchUpdatePriceRequest request, Integer merId);


    /**
     * 云仓商品批量设置运费模板
     * @param request
     * @param merId
     * @return
     */
    CommonResult<Object> batchUpdateShipTemp(BatchUpdateShipTempRequest request, Integer merId);

    /**
     * 重置为分类加价率
     * @param productId
     * @param merId
     * @return
     */
    CommonResult<Object> resetPrice(Integer productId, Integer merId);

    /**
     * 价格尾号设置
     * @param merId
     * @param request
     * @return
     */
    CommonResult<Object> batchPriceTailNumber(Integer merId, BatchPriceTailRequest request);

    /**
     * 价格尾号清除
     * @param merId
     * @param request
     * @return
     */
    CommonResult<Object> batchPriceTailNumberClear(Integer merId, BatchPriceTailRequest request);

    /**
     * 创建商户商品表
     * @author daigb
     * @date:  2022-04-25 17:03
     */
    void createTable(String tableName);

    /**
     * 功能描述: 商户自建商品零售价修改
     * @Param: [requests]
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/12/28 13:37
     */
    Boolean updatePriceByOneself(List<StoreProductOneselfRequest> requests);

    /**
     * 云仓商品发货地国内的 移动到商户表内
     */
    Boolean buildCNGoods(Integer merId);


    List<Integer> selectShippingTempId(String tableName);

    void addShippingTempId(String tableName);

    Boolean downSelfBuildGoods();

    Boolean saveOrUpdateGoods(String tableName, StoreProductMer storeProductMer);

    Boolean removeGoods(String tableName, List<Integer> productIds);

}
